/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.Logtype;

/**
 *
 * @author AQUA
 */
@Stateless
public class LogtypeFacade extends AbstractFacade<Logtype> implements LogtypeFacadeRemote{
    @PersistenceContext(unitName = "ejb-servPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public LogtypeFacade() {
        super(Logtype.class);
    }

    @Override
    public void deleteByID(String id) {
        Logtype logtype = find(id);
        logtype = em.merge(logtype);
        em.remove(logtype);
    }
    
    @Override
    public void insert(Logtype logtype) {
        em.persist(logtype);
    }
    
    @Override
    public Logtype merge(Logtype logtype) {
        return em.merge(logtype);
    }
}
